

                              fd
                             /   \
                _fdopen()  /       \   _get_osfhandle()
              _fileno()  /           \   _open_osfhandle()
                       /               \
                     /                   \
               FILE*                      HANDLE




fd => FILE*         _fdopen()

FILE* => fd         _fileno()


fd => HANDLE        _get_osfhandle()

HANDEL => fd        _open_osfhandle()


FILE* => HANDLE     _get_osfhandle( _fileno( ) )

HANDLE => FILE*     _fdopen( _open_osfhandle( ) )



Create a fd         _open()

Create a FILE*      _fsopen(), fopen()

Create a HANDLE     CreateFile()